<?php
	error_reporting(0);
    require_once 'data/handler.php';
    /*$session = new SessionControl();
    if(!$session->Check()){
        //unset($_SESSION['allow']);
        unset($_SESSION['fprint']);
        unset($_SESSION['salt_']);
    }*/
    session_start();
    if(!isset($_SESSION["isLoggedIn"]) || !($_SESSION["isLoggedIn"] === true)){
        session_unset();
        session_destroy();
    }
?>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Musique Basse</title>
        <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
        <link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
        <script type="text/javascript" src="js/jquery.min.js"></script>
    </head>
    <body>
        <div id="main" class="page">
            <header>
                <h1><img src="buttons/logo.png"/></h1>
                <h6>A music store for all kinds of music listeners</h6>
                <nav>
                    <a href="index.php"><img src="buttons/home.png"/></a>
                    <a href="products.php"><img src="buttons/products.png"/></a>
                    <!--accessible or shown only to logged in users-->
                    <?php //var_dump($_SESSION);
						
                        if(!isset($_SESSION["isLoggedIn"]) || !($_SESSION["isLoggedIn"] === true))
                            echo '<a href="login.php" class="fltright"><img src="buttons/login.png"/></a>';
                        else{
                            echo '<a href="account.php"><img src="buttons/account.png"/></a>';
                            if(isAdmin($_SESSION["uname"]))
                                echo ' <a href="admin.php"><img src="buttons/admincp.png"/></a>';
							echo '<a href="cart.php"><img src="buttons/Cart.png"/></a>';
                            echo '<a href="logout.php" class="fltright"><img src="buttons/logout.png"/></a>';
                        }
                    ?>
                </nav>
            </header>
			<div id="selection">
				By Album
				<a href="products2.php"> / By Artist / </a>
				<a href="products3.php">By Genre</a>
			</div>
            <div id="content" >
                <?php
                    getProducts();
                ?>
            </div>
            
            <div class="clear"></div>
            
            <footer>
                <p>Copyright &copy; 2012 KENNICS. All rights reserved.</p>
                <p>Design by Werdnazner</p>
            </footer>
			<br/><br/><br/>
        </div>
    </body>
</html>
